<h1><a href="<?php echo $this->url(array("controller" => "rss", "action" => "index"), "editor", true); ?>"><?php echo $this->translate->_("RSS"); ?></a> &raquo; <?php echo $this->translate->_("List News"); ?></h1>
<div class="rbcontent" id="search_fields">
	<form name="search" action="<?php echo $this->url; ?>" method="get">
	<input type="hidden" name="order" id="order" value="<?php echo $this->order; ?>" />
	<input type="hidden" name="dir" id="dir" value="<?php echo $this->dir; ?>" />
	<table>
	<col width="430" />
		<tr>
			<td>
				<div class="filter_item">
					<label><?php echo $this->translate->_("Title"); ?>:</label>
					<input type="text" name="title" value="<?php echo $this->title; ?>" />
				</div>
			</td>
			<td></td>
		</tr>
		<tr>
			<td>
				<div class="filter_item">
					<label><?php echo $this->translate->_("Link"); ?>:</label>
					<input type="text" name="link" value="<?php echo $this->link; ?>" />
				</div>
			</td>
			<td>
				<div class="filter_item">
					<label></label>
					<input type="button" value="<?php echo $this->translate->_("Search"); ?>" data-type="submit" />
					<input type="button" value="<?php echo $this->translate->_("Reset"); ?>" data-type="reset" />
				</div>
			</td>
		</tr>
	</table>
	</form>
</div>
<?php if(count($this->news) > 0): ?>
	<?php echo $this->paginationControl($this->news, 'Elastic', 'controls.phtml', array('translate' => $this->translate)); ?>
	<table class="main">
		<thead>
			<tr>
				<th class="<?php $col = "title"; echo strcasecmp($this->order, $col) == 0 ? strcasecmp($this->dir, "asc") == 0 ? "sortable selectedUp" : "sortable selectedDown" : "sortable"; ?>" nowrap="nowrap" data-col="<?php echo $col; ?>"><?php echo $this->translate->_("Title"); ?></th>
				<th class="<?php $col = "link"; echo strcasecmp($this->order, $col) == 0 ? strcasecmp($this->dir, "asc") == 0 ? "sortable selectedUp" : "sortable selectedDown" : "sortable"; ?>" nowrap="nowrap" data-col="<?php echo $col; ?>"><?php echo $this->translate->_("Link"); ?></th>
				<th class="<?php $col = "author"; echo strcasecmp($this->order, $col) == 0 ? strcasecmp($this->dir, "asc") == 0 ? "sortable selectedUp" : "sortable selectedDown" : "sortable"; ?>" nowrap="nowrap" data-col="<?php echo $col; ?>"><?php echo $this->translate->_("Author"); ?></th>
				<th class="<?php $col = "date_created"; echo strcasecmp($this->order, $col) == 0 ? strcasecmp($this->dir, "asc") == 0 ? "sortable selectedUp" : "sortable selectedDown" : "sortable"; ?>" nowrap="nowrap" data-col="<?php echo $col; ?>"><?php echo $this->translate->_("Published on"); ?></th>
				<th width="1%"></th>
				<th width="1%"></th>
			</tr>
		</thead>
		<tbody>
			<?php foreach($this->news as $new): ?>
				<tr>
					<td><a href="<?php echo $this->url(array('controller'=>'rss', 'action'=>'edit', 'id'=> $new["id"]), 'editor', true); ?>"><?php echo $new['title']; ?></a></td>
					<td><a href="<?php echo $new['link']; ?>" target="_blank"><?php echo $new['link']; ?></a></td>
					<td><?php echo $new['author']; ?></td>
					<td><?php echo Petolio_Service_Util::formatDate($new["date_created"], null, true, true); ?></td>
					<td nowrap="nowrap" style="text-align: center;"><a href="<?php echo $this->url(array('controller'=>'rss', 'action'=>'edit', 'id'=> $new["id"]), 'editor', true); ?>"><?php echo $this->translate->_("Edit") ?></a></td>
					<td nowrap="nowrap" style="text-align: center;"><a href="<?php echo $this->url(array('controller'=>'rss', 'action'=>'delete', 'id'=> $new["id"]), 'editor', true); ?>"><?php echo $this->translate->_("Delete") ?></a></td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
	<?php echo $this->paginationControl($this->news, 'Elastic', 'controls.phtml', array('translate' => $this->translate)); ?>
<?php else: ?>
	<div class="error"><?php echo $this->translate->_("No records found."); ?></div>
<?php endif; ?>
<form style="background: #fff;">
	<input type="button" onclick="document.location='<?php echo $this->url(array('action' => 'add')); ?>';" class="submit" value="<?php echo $this->translate->_("Add News"); ?>" />
	<div class="clear"></div>
</form>
<script type="text/javascript">
	READY(function() {
		Editor.loadJs('filters/base.js');
		Filters.load('/rss/index');
	});
</script>